﻿using System;
using System.Collections.Generic;
using System.Text;

namespace HDS.Model
{
    public class DataPagingModel<T>
    {
        /// <summary>
        /// 当前页标
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 总页数
        /// </summary>
        public int PageTotal { get; set; } = 0;

        /// <summary>
        /// 每页大小
        /// </summary>
        public int PageSize { set; get; } = 20;

        /// <summary>
        /// 数据总数
        /// </summary>
        public int Total { get; set; } = 0;

        /// <summary>
        /// 返回数据
        /// </summary>
        public List<T> Rows { get; set; }

        public DataPagingModel<E> CopyPageData<E>()
        {
            return new DataPagingModel<E>
            {
                PageIndex = this.PageIndex,
                PageTotal = this.PageTotal,
                PageSize = this.PageSize,
                Total = this.Total,
            };
        }
    }
}
